#ifndef __USART_H__
#define __USART_H__

#include "stm32f10x.h"
#include "sys.h"
#include "esp8266.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

#include "sg90.h"



extern volatile uint8_t  g_usart1_rx_buf[512];
extern volatile uint32_t g_usart1_rx_cnt;
extern volatile uint32_t g_usart1_rx_end;

extern void USART1_Init(uint32_t baud);
extern void USART2_Init(uint32_t baud);
extern void USART3_Init(uint32_t baud);

extern void USARTx_Send_String(USART_TypeDef* USARTx, char *str);
extern void USARTx_Send_Bytes(USART_TypeDef* USARTx, uint8_t *buf, uint32_t len);

static USART_InitTypeDef   		USART_InitStructure;
static GPIO_InitTypeDef 		GPIO_InitStructure;
static NVIC_InitTypeDef   		NVIC_InitStructure;

extern char buf_get[255];


void uart2_rever(void);

#endif



